using FluentNHibernate.Mapping;
using Wikey.Entity;

namespace Wikey.Domain.Mappings
{
    public class ContentNodeMap : ClassMap<ContentNode> {
        public ContentNodeMap() {
            Id(x => x.Id);
            Map(x => x.Description).Length(50);
            Map(x => x.Text).Length(8000);
            References(x => x.CreatedBy).Column("CreatedBy").Cascade.All();
            References(x => x.ModifiedBy).Column("ModifiedBy").Cascade.All();
            HasMany(x => x.PageContentNodes).Inverse().KeyColumn("ContentNodeId").Cascade.All();

            Not.LazyLoad();
        }
    }
}